package com.yswy.domain.entity.tf;

import com.baomidou.mybatisplus.annotation.TableName;
import com.yswy.common.enums.TfPlatformEnums;
import com.yswy.common.enums.TriggerNodeEnums;
import com.yswy.common.enums.base.TypeEnum;
import com.yswy.domain.common.BasePojo;
import com.yswy.domain.entity.user.User;
import com.yswy.domain.vo.gld.addOrUpate.TgEventChildAddOrUpdate;
import com.yswy.domain.vo.gld.addOrUpate.TgEventEnumsAddOrUpdate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
@AllArgsConstructor
@Api(tags = "回传事件枚举")
@TableName(value = "tg_event_enums")
public class TgEventEnums extends BasePojo<TgEvent> {
    @ApiModelProperty("回传key")
    private String eventKey ;
    @ApiModelProperty("缓存时间(天)")
    private Integer cacheTime ;
    @ApiModelProperty("事件名字")
    private String eventName ;
    @ApiModelProperty("是否扣量 0 不开启   1 开启")
    private Integer isBuckle ;
    @ApiModelProperty("投放（上架）平台  0 巨量  1 快手 ")
    private String tfPlatform;


    public TgEventEnums(TgEventEnumsAddOrUpdate res, User user){
        this.eventKey =res.getEventKey();
        TypeEnum tfPlatformEnumsEnum = TypeEnum.messageOf(TfPlatformEnums.class , res.getTfPlatform());
        this.tfPlatform =tfPlatformEnumsEnum.toString();
        this.cacheTime =res.getCacheTime();
        this.eventName =res.getEventName();
        this.isBuckle =res.getIsBuckle();
        super.setCreateBy(user.getId().longValue());
    }
    public TgEventEnums(){

    }

}
